package com.jiutong.meipenggang.http.model.requests;

import com.jiutong.meipenggang.http.RetrofitHandle;
import com.jiutong.meipenggang.http.SubscribeHandler;
import com.jiutong.meipenggang.http.model.services.MainPageServices;
import com.jiutong.meipenggang.http.subscribers.ProgressSubscriber;

import java.util.HashMap;
import java.util.Map;

import rx.Observable;
import rx.Subscriber;

/**
 * Created by bdf on 2017/12/18.
 */

public class MainPageRequest extends SubscribeHandler {
    /**
     * 主页接口
     */
    public void mainPage(Subscriber subscriber, Map<String, Object> fields) {

        handleFields(fields);
        Observable observable = RetrofitHandle.getInstance().retrofit.create(MainPageServices.class)
                .MainPage(fields);

        toSubscribe(observable, subscriber);
    }


    public void MyInverst(ProgressSubscriber progressSubscriber, HashMap<String, Object> fieldsMap) {
        handleFields(fieldsMap);
        Observable observable = RetrofitHandle.getInstance().retrofit.create(MainPageServices.class)
                .MyInverst(fieldsMap);

        toSubscribe(observable, progressSubscriber);
    }

    public void TotalMoney(ProgressSubscriber progressSubscriber, HashMap<String, Object> fieldsMap) {
        handleFields(fieldsMap);
        Observable observable = RetrofitHandle.getInstance().retrofit.create(MainPageServices.class)
                .TotalMoney(fieldsMap);

        toSubscribe(observable, progressSubscriber);
    }
}
